ReImportSubreport Method (Subreport Object)

Subreports can be newly created in the main report or imported from an existing report file. If the subreport is imported from an existing report file, it can be re-imported at runtime using the ReImportSubreport method. When previewed, printed, or exported, a re-imported subreport will reflect all changes made to the formatting, grouping, and structure of the existing report file.

Syntax

Sub ReImportSubreport (pReimported as Boolean)

Parameter

Parameter Description

pReimported

Boolean value indicating success or failure when re-importing the subreport. Will be set to TRUE if re-importing the subreport succeeds and FALSE if re-importing the subreport fails.See remarks below.

Remarks

pReimported is an output parameter. Create a variable to hold the result of pReimported and check the value of the variable to see if the method is successful.

Sample

'Boolean value to hold the result of the ReimportSubreport method
Dim bReimported As Boolean

'Call ReImportSubReport
Report.Subreport1.ReimportSubreport bReimported

'If bReimported is True the subreport re-imported successfully
'If bReimported is False the subreport failed to re-import
If bReimported Then
    MsgBox "Subreport re-imported successfully"
Else
    MsgBox "Subreport failed to re-import"
    Exit Sub
End If

'Refresh the viewer to display the updated subreport.
'Set the parameter to True if you want to update the data
'or False if you only want to refresh the report
CRViewer1.RefreshEx False



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com